package com.gmp.thewizard;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;

public class IntroAlertFragment extends DialogFragment {
	
	public static IntroAlertFragment newInstance(int title){
		IntroAlertFragment frag = new IntroAlertFragment();
		Bundle args = new Bundle();
		args.putInt("title", title);
		frag.setArguments(args);
		return frag;
	}
	
	public Dialog onCreateDialog(Bundle savedInstanceState){
		int title = getArguments().getInt("title");
		
		return new AlertDialog.Builder(getActivity())
		.setTitle(title)
		.setCancelable(false)
		.setMessage("1. Drag the Red Dot to the top of the screen\n2. Do not make contact with any of the Blue Dots, or strange things will happen!\n3. You have 5 seconds from when you first touch the Red Dot\n\nAre you ready?")
		.setCancelable(false)
		.setPositiveButton("Start", new DialogInterface.OnClickListener(){
			public void onClick(DialogInterface dialog, int which){
				((GameActivity) getActivity()).setContentView(new Panel(((GameActivity) getActivity())));
			}
		}).create();
	}
}
